import { http as axios } from './request'

/**
 * 问大家列表
 * @param current 
 * @param size 
 * @param auditStatus 审核状态：0未审核；1.通过，2.未通过
 */
export const questionList = (current: number, schoolId: string, size = 10, auditStatus = 1) => {
	return axios({
		method: 'GET',
		url: '/api/system/problem/page/list',
		params: { current, size, schoolId, auditStatus }
	})
}

/**
 * 回答详情
 * @param current 
 * @param problemId 
 * @param size 
 */
export const questionDetail = (current: number, problemId: string, size = 10) => {
	return axios({
		method: 'GET',
		url: '/api/system/problemReply/page/list',
		params: {
			current,
			problemId,
			size
		}
	})
}

/**
 * 我要提问
 * @param content 
 * @param phone 
 * @param userAvatar 
 * @param userSex 
 */
export const quiz = (content: string, phone: string, userAvatar: string, userSex: number, schoolId: string) => {
	return axios({
		method: 'POST',
		url: '/api/system/problem/add',
		data: {
			content,
			phone,
			userAvatar,
			userSex,
			schoolId
		}
	})
}

//常见问题
export const FAQList = (current: number, size = 10,) => {
	return axios({
		method: 'GET',
		url: '/api/system/faq/page/list',
		params: { current, size}
	})
}